import json


class ReadUtil:

    @classmethod
    def read_file(cls,file_path,key):
        with open(file_path,"r",encoding="utf-8") as f:
            # 打开json文件，读取所有数据并转换成Python的字典形式,并获取字典中的键
            data = json.load(f).get(key)
            # 定义一个list
            list = []
            for item in data:
                temp = tuple(item.values())
                list.append(temp)
            return list

if __name__ == '__main__':
    result = ReadUtil.read_file("../data/register_login.json","image_code")
    print(result)

